home *** CD-ROM | disk | FTP | other *** search
/ Champak 143 / (Vol 143) Nov 15 2011.iso / Games / cubic_shot_3.swf / scripts / frame_3 / DoAction.as < prev   
Text File  |  2011-11-15  |  2KB  |  64 lines

  1. function soundOn()
  2. {
  3.    soundon = "yes";
  4.    _root.blockHitSound = new Sound(this);
  5.    _root.blockHitSound.attachSound("blockHitSoundM");
  6.    _root.lineThrowSound = new Sound(this);
  7.    _root.lineThrowSound.attachSound("lineThrowSoundM");
  8.    _root.lineDrawSound = new Sound(this);
  9.    _root.lineDrawSound.attachSound("lineDrawSoundM");
  10.    _root.boomSound = new Sound(this);
  11.    _root.boomSound.attachSound("boomSoundM");
  12.    _root.heartHitSound = new Sound(this);
  13.    _root.heartHitSound.attachSound("heartHitSoundM");
  14.    _root.startSound = new Sound(this);
  15.    _root.startSound.attachSound("startSoundM");
  16.    _root.buttonSound = new Sound(this);
  17.    _root.buttonSound.attachSound("buttonSoundM");
  18.    _root.readySound = new Sound(this);
  19.    _root.readySound.attachSound("readySoundM");
  20.    _root.gameOverSound = new Sound(this);
  21.    _root.gameOverSound.attachSound("gameOverSoundM");
  22.    _root.titleSound = new Sound(this);
  23.    _root.titleSound.attachSound("titleSoundM");
  24.    _root.backSound = new Sound(this);
  25.    _root.backSound.attachSound("backSoundM");
  26.    _root.backSound.setVolume(50);
  27.    if(nowF == "title")
  28.    {
  29.       _root.titleSound.start(0,999);
  30.    }
  31.    else if(nowF == "roundClear")
  32.    {
  33.       _root.roundClearSound.start(0,999);
  34.    }
  35.    else if(nowF == "main")
  36.    {
  37.       _root.backSound.start(0,999);
  38.    }
  39. }
  40. function soundOff()
  41. {
  42.    soundon = "no";
  43.    delete _root.blockHitSound;
  44.    delete _root.lineThrowSound;
  45.    delete _root.boomSound;
  46.    delete _root.heartHitSound;
  47.    delete _root.startSound;
  48.    delete _root.buttonSound;
  49.    delete _root.readySound;
  50.    _root.lineDrawSound.stop();
  51.    delete _root.lineDrawSound;
  52.    _root.backSound.stop();
  53.    delete _root.backSound;
  54.    _root.titleSound.stop();
  55.    delete _root.titleSound;
  56.    _root.gameOverSound.stop();
  57.    delete _root.gameOverSound;
  58. }
  59. nowF == "noting";
  60. trace("\n");
  61. trace("-------------------------");
  62. trace("Start : opening");
  63. _root.soundOn();
  64.